<template>
  <el-form label-width="90px" size="mini">
    <el-collapse value="1" class="customer-collapse">
      <chart-base-option :attribute="attribute"></chart-base-option>
      <chart-xy-option :attribute="attribute"></chart-xy-option>
      <el-collapse-item title="柱体">
        <el-form-item label="图形方向">
          <tm-radio v-model="attribute.direction" :data="directionList"></tm-radio>
        </el-form-item>
        <div class="group">
          <div class="group-label">
            基础
          </div>
          <div class="group-content">
            <el-form-item label="是否堆叠">
              <el-switch v-model="attribute.isStack" />
            </el-form-item>
            <el-form-item label="柱体背景">
              <el-switch v-model="attribute.series.showBackground" />
            </el-form-item>
          </div>
        </div>

        <div class="group">
          <div class="group-label">
            柱体
          </div>
          <div class="group-content">
            <el-form-item label="柱体宽度">
              <el-input v-model="attribute.series.barWidth" />
            </el-form-item>
            <el-form-item label="文字大小">
              <el-input-number v-model="attribute.series.label.fontSize" />
            </el-form-item>
            <el-form-item label="格式">
              <el-input v-model="attribute.series.label.formatter" />
            </el-form-item>
          </div>
        </div>
        <div class="group">
          <div class="group-label">圆角</div>
          <div class="group-content">
            <el-form-item label="左上">
              <el-input-number :min="0" v-model="attribute.series.itemStyle.borderRadius[0]" />
            </el-form-item>
            <el-form-item label="右上">
              <el-input-number :min="0" v-model="attribute.series.itemStyle.borderRadius[1]" />
            </el-form-item>
            <el-form-item label="右下">
              <el-input-number :min="0" v-model="attribute.series.itemStyle.borderRadius[2]" />
            </el-form-item>
            <el-form-item label="左下">
              <el-input-number :min="0" v-model="attribute.series.itemStyle.borderRadius[3]" />
            </el-form-item>
          </div>
        </div>
      </el-collapse-item>
    </el-collapse>
  </el-form>
</template>

<script>
import tmRadio from '@/package/components/tm-radio'
import chartBaseOption from '../chart-base-option'
import chartXyOption from '../chart-xy-option'

export default {
  name: 'bar01-option',
  cnName: 'bar01-option',
  components: {
    tmRadio,
    chartBaseOption,
    chartXyOption
  },
  props: {
    attribute: Object
  },
  data() {
    return {
      directionList: [
        {label: '竖向', value: '0'},
        {label: '横向', value: '1'}
      ]
    }
  },
  methods: {}
}
</script>

<style lang="less" scoped>
</style>
